package feeinterface.dao;

import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import com.ulwx.database.DbException;
import com.ulwx.tool.DbUtils;
import feeinterface.modeldb.BaseDynamicQuestionAnswerForEdit;

/**
 * 动态验证问题答案收集表
 * 
 * @author 黄杰
 * 
 */
public class BaseDynamicQuestionAnswerForEditDao {
	private static Logger log = Logger
			.getLogger(BaseDynamicQuestionAnswerForEditDao.class);
	/**
	 * 
	 * @param entity
	 * @return
	 * @throws DbException
	 */
	public static void InsertData(BaseDynamicQuestionAnswerForEdit model) {
		try {
			String sql = "INSERT INTO BaseDynamicQuestionAnswerForEdit(ProvinceID,Question,AddTime)" +
					     " VALUES (0,?,?) ON DUPLICATE KEY UPDATE AddTime=?";
			Map<Integer, Object> map = new HashMap<Integer, Object>();
			//map.put(1, model.getProvinceID());
			map.put(2, model.getQuestion());
			map.put(3, model.getAddTime());
			map.put(4, model.getAddTime());
			DbUtils.executeBindUpdate(null, sql, map);
		} catch (Exception e) {
			log.error("", e);

		}
	}
}
